//**为通配符,vite不支持require导入方式,故用import.meta.glob(vite动态导入)
const modules = import.meta.glob('@/views/**/*.vue');
const handleRouter = (list: AuthRoute.Route[]) => {
	const routerList = list.filter((item: AuthRoute.Route) => {
		if (item.children && item.children.length) {
			item.children = handleRouter(item.children);
		} else {
			const name = item.component;
			item.component = modules['/src/views' + name + '.vue'];
		}
		return item; // 确保返回项，避免为空数组
	});
	return routerList;
};
export default handleRouter;
